import {
    observable,
    action
} from "mobx-miniprogram";

export const callLogsFilterStore = observable({
    // 坐席人员数据
    serverUserList: [],
    //  处置类型
    dealType: [],
    //  科室ID
    deptIdList: [],
    //  结束日期(yyyy-MM-dd)
    endTime: '',
    //  坐席人ID
    receptionList: [],
    //  开始日期(yyyy-MM-dd)
    startTime: '',
    //  电话类型：0已接，1拨出，2未接
    type: [],
    onTag: action(function (event) {
        const key = event.currentTarget.dataset.key
        const value = event.detail.value
        this[key] = value
    }),
    onChangeTime: action(function (event) {
        const value = event.detail.value
        this.startTime = value[0]
        this.endTime = value[1]
    }),
    setDeptIdList: action(function (data) {
        this.deptIdList = data.map(item => data.value)
    }),
    setReceptionList: action(function (data) {
        this.receptionList = data.map(item => data.userId)
    }),
    // 设置坐席人员数据
    setServerUserList: action(function (data) {
        this.serverUserList = data
    })

})